package com.geekteam.manga.ui.adapter;

import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * @author MtRol
 * 
 */
public class TabPagerAdapter extends FragmentPagerAdapter {
	private static final String[] CONTENT = new String[] { "Truyện hót", "Truyện mới", "Vừa xem", "Yêu thích"};
	private List<Fragment> mListFragments;

	public TabPagerAdapter(FragmentManager fm, List<Fragment> listFragment) {
		super(fm);
		mListFragments = listFragment;
	}

	@Override
	public Fragment getItem(int position) {
		return mListFragments.get(position);
	}

	@Override
	public int getCount() {
		return mListFragments.size();
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return CONTENT[position % CONTENT.length];
	}
}
